//
//  AddCreditCardViewController.m
//  WBBaseProject
//
//  Created by 吴斌 on 2018/3/13.
//  Copyright © 2018年 吴斌. All rights reserved.
//

#import "AddCreditCardViewController.h"
#import "InputView.h"
#import "ChooseView.h"

@interface AddCreditCardViewController ()

@end

@implementation AddCreditCardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"添加信用卡";
    [self setupUI];
}

- (void)setupUI
{
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kNavigationBarHeight)];
    scrollView.contentSize = CGSizeMake(kScreenWidth, kScreenHeight - kNavigationBarHeight + 1);
    scrollView.bounces = YES;
    scrollView.backgroundColor = WB_RGBColor(240, 240, 240);
    [self.view addSubview:scrollView];
    
    InputView *view1 = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([InputView class])  owner:self options:nil].firstObject;
    view1.titleLb.text = @"持卡人";
    view1.inputTF.text = @"吴斌";
    view1.inputTF.enabled = NO;
    view1.lineView.hidden = YES;
    view1.frame = CGRectMake(0, kBlankHeight, kScreenWidth, kRowHeight);
    //    _branchTF = view3.inputTF;
    [scrollView addSubview:view1];
    
    InputView *view2 = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([InputView class])  owner:self options:nil].firstObject;
    view2.titleLb.text = @"信用卡号";
    view2.inputTF.text = @"吴斌";
    view2.frame = CGRectMake(0, 2 * kBlankHeight + kRowHeight, kScreenWidth, kRowHeight);
    //    _branchTF = view3.inputTF;
    [scrollView addSubview:view2];
    
    ChooseView *view3 = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([ChooseView class])  owner:self options:nil].firstObject;
    view3.titleLb.text = @"信用额度";
    //    view3.inputTF.text = @"吴斌";
    view3.frame = CGRectMake(0, 2 * kBlankHeight + 2 * kRowHeight, kScreenWidth, kRowHeight);
    //    _branchTF = view3.inputTF;
    [scrollView addSubview:view3];
    
    ChooseView *view4 = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([ChooseView class])  owner:self options:nil].firstObject;
    view4.titleLb.text = @"还款日";
    view4.lineView.hidden = YES;
    view4.choose = ^(UIButton *button) {
        DebugLog(@"福");
        
    };
    //    view4.inputTF.text = @"吴斌";
    view4.frame = CGRectMake(0, 2 * kBlankHeight + 3 * kRowHeight, kScreenWidth, kRowHeight);
    //    _branchTF = view3.inputTF;
    [scrollView addSubview:view4];

    UIButton *sureBtn = [Factory customButtonWithTitle:@"确定"];
    sureBtn.frame = CGRectMake(55, 35 + CGRectGetMaxY(view4.frame), kScreenWidth - 110, 50);
    [scrollView addSubview:sureBtn];
}

@end
